//
// Created by zhaog on 31/03/17.
//

#ifndef IMG_SVR_REQ_HANDLER_H
#define IMG_SVR_REQ_HANDLER_H

#include "Poco/Net/HTTPServer.h"
#include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPServerRequest.h"
using Poco::Net::HTTPServerRequest;
using Poco::Net::HTTPServerResponse;
using Poco::Net::HTTPServer;
using Poco::SharedPtr;
using Poco::ThreadPool;
using Poco::Net::HTTPServerParams;
using Poco::Net::ServerSocket;


namespace img_svr{
    class ReqHandler: public Poco::Net::HTTPRequestHandler{
    public:
        void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response);
        virtual void handleRequestImpl(HTTPServerRequest& request, HTTPServerResponse& response)=0;
        virtual ~ReqHandler(){}
    private:
        std::string _req_method;
        std::string _req_client_host;
        std::string _req_uri;
        std::string _req_http_version;
        int _content_length;
    protected:
        std::string _res_body;
        std::string _info_log;
    };
}

#endif //IMG_SVR_REQ_HANDLER_H
